From: Jan Beulich Date: Thu, 16 Sep 2021 09:02:48 +0000 (+0200) Subject: VT-d: skip IOMMU bitmap cleanup for phantom devices X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~184 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=9d92140d0255e14d8c3eaba7edc931327eb96fd0;p=xen.git VT-d: skip IOMMU bitmap cleanup for phantom devices Doing the cleanup also for phantom devices is at best redundant with doing it for the corresponding real device. I couldn't force myself into checking all the code paths whether it really is: It seems better to explicitly skip this step in such cases. Signed-off-by: Jan Beulich Reviewed-by: Kevin Tian --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 9827ab184d..aeb1dddc88 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1733,7 +1733,7 @@ static int domain_context_unmap(struct domain *domain, u8 devfn, return -EINVAL; } - if ( ret || QUARANTINE_SKIP(domain) ) + if ( ret || QUARANTINE_SKIP(domain) || pdev->devfn != devfn ) return ret; /*